package interfaces.interfaceprocessor;

import java.util.Arrays;

public abstract class StringProcessor  implements Processor{

	public String name(){
		return getClass().getSimpleName();
	}
	public abstract String process(Object input);
	public static String s = "If she weighs the same as a duck,she's made of wood";

	public static void main(String[] args) {
		Apply.process(new Upcase(), s);
		Apply.process(new Downpcase(), s);
		Apply.process(new Splitter(), s);
	}
}

class Upcase extends StringProcessor {

	@Override
	public String process(Object input) {
		// TODO Auto-generated method stub
		return ((String)input).toUpperCase();
	}
}

class Downpcase extends StringProcessor {

	@Override
	public String process(Object input) {
		// TODO Auto-generated method stub
		return ((String)input).toLowerCase();
	}
}

class Splitter extends StringProcessor {

	@Override
	public String process(Object input) {
		// TODO Auto-generated method stub
		return Arrays.toString(((String)input).split(" "));
	}
}